from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By
d=webdriver.Edge()
d.get("http://www.baidu.com")
sleep(2)
aelments=d.find_elements(By.CLASS_NAME,"mnav.c-font-normal.c-color-t")
for i in aelments:
    i.click()
sleep(5)

list1 = d.window_handles
for i in list1:
    print(i)

c=d.current_window_handle
print(c)
print(d.title)
sleep(2)

d.switch_to.window(list1[3])
# e1 = d.switch_to.window(d.window_handles[2])
print(d.title)
sleep(20)

